<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <h3>Installed CLI Plugins</h3>
    <draggable v-model="myArray" draggable=".item">
      <div v-for="element in myArray" :key="element.id" class="item">
          {{element.name}}
      </div>
    </draggable>
  </div>
</template>

<script>
import draggable from 'vuedraggable'

export default {
  name: 'HelloWorld',
  props: {
    msg: String
  },
  components: {
    draggable
  },
  // created: {
    
  // },
  data() {
    return {
      myArray: [
        {name: 'tex',id: 2},
        {name: 'sss',id: 1},
        {name: 'opp',id: 3},
      ]
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
  margin: 40px 0 0;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
